//
//  PKPublishLiveViewModel.swift
//  Panku
//
//  Created by mac on 2017/2/23.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit
import ReactiveSwift
import ReactiveCocoa
import Result

class PKPublishLiveViewModel: NSObject {
    
    var geoLocation = MutableProperty("未知")
    
    var liveTitle = MutableProperty("")
    
    var newLiveModel:PKNewLiveModel?
    
    //action
    func actionForStartNewLive() -> Action<(String,String,String,Int,String),Any,NSError>{
        return Action<(String,String,String,Int,String),Any,NSError>{ (parameters) -> SignalProducer<Any, NSError> in
            
            let name = parameters.0
            let address = parameters.1
            let imgUrl = parameters.2
            let userId = parameters.3
            let userName = parameters.4
            
            return PKPublishServices.newLive(name: name, address: address, imageUrl: imgUrl, userId: userId, userName: userName)
        }
    }
    
    func actionForGeoLocation() -> Action<Void,String,NoError> {
        return Action<Void,String,NoError>{ (_) -> SignalProducer<String, NoError> in
            
            return PKLocationUtils.currentCity()
        }

        
    }
    
}
